package com.example.larouzey.widgettest201ljy;

import android.content.Intent;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.FocusFinder;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class newActivity extends AppCompatActivity implements View.OnClickListener{

    private Button bt3;
    private TextView tv2;




    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new);
        Intent intent=getIntent();
        String str = intent.getStringExtra("param1");
        int n = intent.getIntExtra("param2",10);
        System.out.println(str+"---"+String.valueOf(n));
        Toast.makeText(this,str+"---"+String.valueOf(n),Toast.LENGTH_SHORT);

        //获取主页面输入文本显示到新页面中
        TextView tv2 = (TextView)findViewById(R.id.textView2);
        tv2.setText(str+"---"+String.valueOf(n));

        Button bt3= (Button) findViewById(R.id.button3);
        bt3.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.button3:
                finish();
                break;

        }
    }
}
